package de.tudarmstadt.ukp.wikisniffer.userstudy.evaluation;

import java.util.Date;

import de.tudarmstadt.ukp.wikisniffer.userstudy.datastore.ResultStore.Action;
import de.tudarmstadt.ukp.wikisniffer.userstudy.datastore.ResultStore.Task;

public class ActionLine {
	
	private void setTask(Task task) {
		this.task = task;
	}

	private void setDate(Date date) {
		this.date = date;
	}

	private void setInfo(String info) {
		this.info = info;
	}

	private void setAction(Action action) {
		this.action = action;
	}

	public Task getTask() {
		return task;
	}

	public Date getDate() {
		return date;
	}

	public String getInfo() {
		return info;
	}

	public Action getAction() {
		return action;
	}

	private Task task;
	private Date date;
	private String info;
	private Action action;
	
	public ActionLine(String actionLine){
		String[] lineArray = actionLine.split("\t");
		if(lineArray.length == 4){
			this.setAction(Action.valueOf(lineArray[0]));
			this.setTask(Task.valueOf(lineArray[1]));
			this.setInfo(lineArray[2]);
			this.setDate(new Date(Long.valueOf(lineArray[3])));
		}
	}

	public boolean isNewPerson() {
		return (this.action == Action.INFO);
	}

}
